<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{$Think.lang.install_info} - {$Think.lang.install}</title>

    <css href="__ROOT__/asserts/bootstrap/css/bootstrap.yeti.min.css" />
    <present name="addon_css">
        <foreach name="addon_css" item="i" key="k">
            <css href="{$k}" />
        </foreach>
    </present>
    <js href="__ROOT__/asserts/js/jquery-2.0.0__JS_SUFFIX__" />
    <present name="addon_hjs">
        <foreach name="addon_hjs" item="i" key="k">
            <js href="{$k}" />
        </foreach>
    </present>
    <!--[if lt IE 9]>
    <js href="__ROOT__/asserts/bootstrap/js/html5shiv.min.js" />
    <js href="__ROOT__/asserts/bootstrap/js/response.min.js" />
    <![endif]-->
    <script type="text/javascript">
        var TPX={
            PATH_ROOT : '__ROOT__',
            PATH_ASSERTS:'__ROOT__/asserts',
            SUFFIX_JS:'__JS_SUFFIX__',
            SUFFIX_CSS:'__CSS_SUFFIX__',
            LANG:'<?php echo LANG_SET; ?>',
            UEDITOR:[]
        };
        var require = {
            baseUrl : '__ROOT__/asserts/js'
        };
    </script>
    <js href="__ROOT__/asserts/js/require__JS_SUFFIX__" />
</head>
<body>

<div class="container">
    <div class="header">
        <h3 class="text-muted">{$Think.lang.install} [ {$Think.lang.install_info} ]</h3>
    </div>


    <div class="well">

        <form class="form-horizontal tpx-ajaxsubmit" role="form" action="{:U('Install/commonstep3')}" method="post">

            <legend class="">{$Think.lang.db}</legend>

            <div class="form-group">
                <label class="col-sm-2 control-label">{$Think.lang.db_type}</label>
                <div class="col-sm-10">
                    <select name="db_type" class="form-control" style="width:auto;">
                        <option value="mysql">MySQL</option>
                    </select>
                    <div class="help-block"></div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{$Think.lang.db_host}</label>
                <div class="col-sm-10">
                    <input name="db_host" type="text" class="form-control" placeholder="" required="required" value="localhost" style="width:20em;" />
                    <div class="help-block"></div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{$Think.lang.db_port}</label>
                <div class="col-sm-10">
                    <input name="db_port" type="text" class="form-control" placeholder="" required="required" value="3306" style="width:10em;" />
                    <div class="help-block"></div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{$Think.lang.db_name}</label>
                <div class="col-sm-10">
                    <input name="db_name" type="text" class="form-control" placeholder="" required="required" value="tpx" style="width:20em;" />
                    <div class="help-block"></div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{$Think.lang.db_user}</label>
                <div class="col-sm-10">
                    <input name="db_user" type="text" class="form-control" placeholder="" required="required" value="root" style="width:20em;" />
                    <div class="help-block"></div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{$Think.lang.db_pwd}</label>
                <div class="col-sm-10">
                    <input name="db_pwd" type="text" class="form-control" placeholder="" value="" style="width:20em;" />
                    <div class="help-block"></div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">{$Think.lang.db_prefix}</label>
                <div class="col-sm-10">
                    <input name="db_prefix" type="text" class="form-control" placeholder="" required="required" value="tpx_" style="width:10em;" />
                    <div class="help-block"></div>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="button" class="btn btn-default" onclick="db_test();">{$Think.lang.db_test}</button>
                </div>
            </div>

            <script type="text/javascript">
            function db_test(){
                $.post("{:U('Install/dbtest')}",{
                    db_type:$('select[name=db_type]').val(),
                    db_host:$('input[name=db_host]').val(),
                    db_port:$('input[name=db_port]').val(),
                    db_name:$('input[name=db_name]').val(),
                    db_user:$('input[name=db_user]').val(),
                    db_pwd:$('input[name=db_pwd]').val(),
                    db_prefix:$('input[name=db_prefix]').val(),
                }, $.defaultFormCallback);
            }
            </script>

            <legend class="">网站信息</legend>

            <div class="form-group">
                <label class="col-sm-2 control-label">绑定域名/IP</label>
                <div class="col-sm-10">
                    <input name="admin_domain" type="text" class="form-control" placeholder="" required="required" value="{$Think.const.HTTP_HOST}" style="width:20em;" />
                    <div class="help-block">不包含http://和任何斜杠，例如：www.tecmz.com</div>
                </div>
            </div>


            <legend class="">{$Think.lang.admin}</legend>

            <div class="form-group">
                <label class="col-sm-2 control-label">{$Think.lang.admin_username}</label>
                <div class="col-sm-10">
                    <input name="admin_username" type="text" class="form-control" placeholder="" required="required" value="" style="width:20em;" />
                    <div class="help-block"></div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">{$Think.lang.admin_password}</label>
                <div class="col-sm-10">
                    <input name="admin_password" type="text" class="form-control" placeholder="" required="required" value="" style="width:20em;" />
                    <div class="help-block"></div>
                </div>
            </div>


            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-primary btn-md">{$Think.lang.submit}</button>
                </div>
            </div>
        </form>


    </div>

    <div class="footer">
        <p>{$Think.lang.contact}</p>
    </div>

</div>

<js href="__ROOT__/asserts/bootstrap/js/bootstrap__JS_SUFFIX__" />
<js href="__ROOT__/asserts/js/jquery.extern__JS_SUFFIX__" />
</body>
</html>